package com.cochain.ftp;

import com.cochain.dynamicdatasource.DBContextHolder;
import com.cochain.dynamicdatasource.entity.po.Database;
import com.cochain.dynamicdatasource.entity.po.Tables;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class FileRemoteController {

    @Autowired
    private FtpUtil ftpUtil;

    @GetMapping("/testFtp")
    public String testFtp() throws Exception {
        ftpUtil.download("/usr/local","startup.sh","/usr/");

        return "ok";
    }

    @GetMapping("/testFtpdownload")
    public String testFtpdownload() throws Exception {
        ftpUtil.downloadFile("/usr/local","startup.sh","/usr/");

        return "ok";
    }
}
